  <div class="content">
  {if (empty($config['yaoyiyaotip']))}
    <img class="lazy" src="{$_G['URL']['WORKER_CSS']}images/yaoyiyao.gif" />
  {else}
    <img class="lazy" src="{php echo tomedia($config['yaoyiyaotip']);}" />
  {/if}
</div>
<style type="text/css">
.show_allpersonal {padding: 10px; margin-top: -40px; position: relative;}
.show_allpersonal div {background: #ffdf01; padding: 5px; border-radius: 10px;}
.show_allpersonal div ul {border: 1px dotted #fff; text-align: center; color: #000; height: 38px; line-height: 38px; font-size: 12px; border-radius: 10px;}
</style>

    <div class="metro_container content shake_moneybg" style="padding: 0; margin-bottom: 0;
        background: #2f2f2f;">
        <div class="content show_allpersonal" style="margin-top:0px;">
            <div class="content">
                <ul class="content">
                    <li style="color: #685B02; font-weight:bold;"><span>&#24050;&#26377;<b style="color:#ED155B">{$commyaoyiyao}</b>&#20154;&#25671;&#21040;&#29616;&#37329;<b style="color:#ED155B">{$commyaoyiyaofee}</b>&#20803;</span></li>
                </ul>
            </div>
        </div>
    </div>

    <audio id="musicBox">   
      <source src="http://css.yixuan.net/weike/images/yaoyiyao.mp3" type="audio/mpeg">
    </audio>
<script type="text/javascript">
//整理图片尺寸
window.onload = function(){
	var photo_size2 = $(".fudai_shake ol img:first").width() / 1.6;
	$(".photo_size2").height(photo_size2);
}

function openshake() { 
	setTimeout(function () {
		$('#fudai').removeClass('get_shake');
		closeshake();
	}, 500) ;
}
function closeshake() { 
	setTimeout(function () {
		$('#fudai').addClass('get_shake');
		openshake();
	}, 500) ;
}
openshake();

window.onload = function() {
    function show_register(){
    	var go_top = $(".fudai_shake").offset().top;
    	$(".fudai_shake").show();
    	$('html,body').animate({scrollTop: go_top}, 800)
    }
	{php echo empty($lingqu)?"":"show_register();";}
};
</script>

<!--摇一摇JS-->
<script>
document.addEventListener("WeixinJSBridgeReady", function () {
        document.getElementById('musicBox').play();
        document.getElementById('musicBox').pause();
}, false);

window.onload=function(){
	init();
}

var SHAKE_THRESHOLD=3000;//定义一个摇动的阈值
var last_update=0;//定义一个变量记录上一次摇动的时间
var x=y=z=last_x=last_y=last_z=0;//定义x、y、z记录三个轴的数据以及上一次触发的时间
function init(){
    //判断移动浏览器是否支持运动传感器事件
    if(window.DeviceMotionEvent){
        //添加一个事件监听器
        window.addEventListener('devicemotion',deviceMotionHandler,false);
        }else{
        ds.dialog({
           title : '&#32418;&#21253;&#25552;&#31034;',
           content : '&#24744;&#30340;&#35774;&#22791;&#19981;&#25903;&#25345;&#25671;&#19968;&#25671;&#65281;',
           yesText : '&#30830;&#23450;',
           timeout :2.5,
        });
    }
}

var shake_num = 1;

function deviceMotionHandler(eventData){
    var acceleration=eventData.accelerationIncludingGravity;
    var curTime=new Date().getTime();
    var diffTime=curTime-last_update;

    if(diffTime>100){
        last_update=curTime;//记录上一次摇动的时间
        x=acceleration.x;//获取加速度X方向
        y=acceleration.y;//获取加速度Y方向
        z=acceleration.z;//获取加速度垂直方向
        var speed=Math.abs(x+y+z-last_x-last_y-last_z)/diffTime*10000;//计算阈值

        if(speed>SHAKE_THRESHOLD){
            if(shake_num > 1){
                return false;
            }
            shake_num=2;
            //top.location.href = top.location.href+"#";
            document.getElementById('musicBox').play();
            setTimeout(dogetprize,1000);
        }
        //记录上一次加速度
        last_x=x;
        last_y=y;
        last_z=z;
    }
}




var doingshakeprize = false;
function dogetprize(){
	if(doingshakeprize){
		return false;
	}
      wid = {php echo empty($workerid)?0:$workerid;};
     $.ajax({
          type: 'POST',
          dataType : "json",
          url:'/{php echo createMobileUrl("yaoyiyao",array("themeid"=>$themeid,"op"=>"get"));}',
          data: {GLat:GLat,GLng:GLng,wid:wid},
          success: function(data) {
              data = data.message;
              if(data.errcode == 3){
                ds.dialog({
                  title : '&#25805;&#20316;&#25552;&#31034;',
                  content : '&#24685;&#21916;&#24744;&#33719;&#24471;&#32418;&#21253;'+data.fee+'&#20803;',
                  yesText : '&#30830;&#23450;',
                    timeout :3.5,
                });
              return false;
             }else{
              if(data.errcode == 2){
                ds.dialog({
                  title : '&#25805;&#20316;&#25552;&#31034;',
                  content : '&#24685;&#21916;&#24744;&#33719;&#24471;&#32418;&#21253;'+data.fee+'&#20803;&#44;&#38142;&#25509;&#20998;&#20139;&#33267;&#26379;&#21451;&#22280;&#21363;&#21487;&#25552;&#29616;',
                  yesText : '&#30830;&#23450;',
                    timeout :4.0,
                });
              return false;
             }else{
              if(data.errcode == 5){
                ds.dialog({
                  title : '&#25805;&#20316;&#25552;&#31034;',
                  content : data.msg,
                  yesText : '&#30830;&#23450;',
                    timeout :4.0,
                });
              return false;
             }else{
               tips(data.msg);
             }}}
          },
}).error(function(){doingmarkshare = false});
}






</script>